package com.zr.eim.service.impl;

import java.util.List;
import com.zr.common.utils.DateUtils;
import com.zr.eim.domain.EimAnalysisScreen;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zr.eim.mapper.EimDataDiagnosticInfoMapper;
import com.zr.eim.domain.EimDataDiagnosticInfo;
import com.zr.eim.service.IEimDataDiagnosticInfoService;

/**
 * 确诊信息Service业务层处理
 * 
 * @author peihang
 * @date 2022-10-21
 */
@Service
public class EimDataDiagnosticInfoServiceImpl implements IEimDataDiagnosticInfoService 
{
    @Autowired
    private EimDataDiagnosticInfoMapper eimDataDiagnosticInfoMapper;

    /**
     * 查询确诊信息
     * 
     * @param id 确诊信息主键
     * @return 确诊信息
     */
    @Override
    public EimDataDiagnosticInfo selectEimDataDiagnosticInfoById(Long id)
    {
        return eimDataDiagnosticInfoMapper.selectEimDataDiagnosticInfoById(id);
    }

    /**
     * 查询确诊信息列表
     * 
     * @param eimDataDiagnosticInfo 确诊信息
     * @return 确诊信息
     */
    @Override
    public List<EimDataDiagnosticInfo> selectEimDataDiagnosticInfoList(EimDataDiagnosticInfo eimDataDiagnosticInfo)
    {
        return eimDataDiagnosticInfoMapper.selectEimDataDiagnosticInfoList(eimDataDiagnosticInfo);
    }

    /**
     * 新增确诊信息
     * 
     * @param eimDataDiagnosticInfo 确诊信息
     * @return 结果
     */
    @Override
    public int insertEimDataDiagnosticInfo(EimDataDiagnosticInfo eimDataDiagnosticInfo)
    {
        eimDataDiagnosticInfo.setCreateTime(DateUtils.getNowDate());
        return eimDataDiagnosticInfoMapper.insertEimDataDiagnosticInfo(eimDataDiagnosticInfo);
    }

    /**
     * 修改确诊信息
     * 
     * @param eimDataDiagnosticInfo 确诊信息
     * @return 结果
     */
    @Override
    public int updateEimDataDiagnosticInfo(EimDataDiagnosticInfo eimDataDiagnosticInfo)
    {
        return eimDataDiagnosticInfoMapper.updateEimDataDiagnosticInfo(eimDataDiagnosticInfo);
    }

    /**
     * 批量删除确诊信息
     * 
     * @param ids 需要删除的确诊信息主键
     * @return 结果
     */
    @Override
    public int deleteEimDataDiagnosticInfoByIds(Long[] ids)
    {
        return eimDataDiagnosticInfoMapper.deleteEimDataDiagnosticInfoByIds(ids);
    }

    /**
     * 删除确诊信息信息
     * 
     * @param id 确诊信息主键
     * @return 结果
     */
    @Override
    public int deleteEimDataDiagnosticInfoById(Long id)
    {
        return eimDataDiagnosticInfoMapper.deleteEimDataDiagnosticInfoById(id);
    }


    /**
     * 查询当前确诊人数
     * 需求模块：数据大屏
     */
    @Override
    public int getCurrentNum(){
        return eimDataDiagnosticInfoMapper.getCurrentNum();
    }

    /**
     * 查询当前各区域的确诊人数
     * 需求模块：数据大屏
     */
    @Override
    public List<EimAnalysisScreen> getAddressAndNum(){
        return eimDataDiagnosticInfoMapper.getAddressAndNum();
    }

    /**
     * 查询近七日确诊人数
     * 需求模块：数据大屏
     */
    @Override
    public List<EimAnalysisScreen> getDiagnosticNumAndDate(){
        return eimDataDiagnosticInfoMapper.getDiagnosticNumAndDate();
    }
}
